//
//  WebViewController.m
//  FangXinLang
//
//  Created by AJY on 16/9/19.
//  Copyright © 2016年 AJY. All rights reserved.
//

#import "WebViewController.h"

@interface WebViewController ()

@end

@implementation WebViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.web.backgroundColor=[UIColor whiteColor];
    self.navigationController.navigationBar.hidden=YES;
    NSURL *url=[NSURL URLWithString:self.url];
    NSURLRequest *re=[NSURLRequest requestWithURL:url];
    [self.web loadRequest:re];
    UIButton *btn=[UIButton buttonWithType:UIButtonTypeCustom];
    btn.frame=CGRectMake(0, 0, 100, 44);
    [btn setTitle:@"新浪新闻" forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:@"navigationbar_back_icon@3x"] forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
//    UIBarButtonItem *item=[[UIBarButtonItem alloc]initWithCustomView:btn];
//    self.navigationItem.leftBarButtonItem=item;
//    [self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];
    
}
-(void)back{
    
    self.navigationController.navigationBar.hidden=NO;
    self.navigationController.navigationBar.alpha=0;
    self.hidesBottomBarWhenPushed=NO;
    [self.navigationController.navigationBar setBarTintColor:[UIColor redColor]];
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
